﻿using lazada.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace lazada.DAL
{
    public class ImageFloorDAL:ConnectionDB
    {
        public ImageFloorDAL(): base()
        {

        }

        public List<ImageModel> THUONGHIEUimage()
        {
            List<ImageModel> list = new List<ImageModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from THUONGHIEUimage";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while(dr.Read())
            {
                ImageModel img = new ImageModel();

                img.image = dr["ImagePath"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T1image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T1image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T2image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T2image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T3image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T3image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T4image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T4image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T5image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T5image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T6image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T6image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T7image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T7image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T8image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T8image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T9image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T9image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T10image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T10image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T11image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T11image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
        public List<ImageFloorModel> T12image()
        {
            List<ImageFloorModel> list = new List<ImageFloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from T12image";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while (dr.Read())
            {
                ImageFloorModel img = new ImageFloorModel();
                img.image1 = dr["C1"].ToString();
                img.image2 = dr["C2"].ToString();
                img.image3 = dr["C3"].ToString();
                img.image4 = dr["C4"].ToString();
                list.Add(img);
            }
            Connection.Close();
            return list;
        }
    }
}